Static Memory Management for Logic Programming Languages

نویسنده

  • Quan Phan
چکیده

Introduction. Logic programming (LP) languages aim to free programmers from procedural details such as memory management tasks. One classical, automatic memory management technique in logic programming is to use a heap memory for all the structured terms and rely on backtracking and on a runtime garbage collector to reclaim memory. While efficient implementation of garbage collectors for LP languages can reuse more than 90% heap space, they introduce performance penalties to the execution of a program because the collectors need to temporarily stop the main program to do their job. Background Literature. To remedy this shortcoming there has been a lot of research on compile-time memory management techniques, which automatically enhance programs with instructions to reuse memory. This static method generally follows two approaches: region-based memory management (RBMM) and compile-time garbage collection (CTGC). The basic idea of RBMM is to divide the heap memory into different regions. The dynamically created terms and their subterms have to be distributed over the regions in such a way that at a certain point in the execution of the program all terms in a region are dead and the region can be removed. CTGC detects when allocated memory cells are no longer used and instructs the program to reuse those cells to construct new terms, reducing memory consumption and in some cases achieving faster code. RBMM has long been a topic of intensive research for functional programming languages [7, 1, 4] and more recently also for procedural languages [3, 2]. For LP languages, there has been only one attempt to make RBMM work for Prolog [5]. The idea of CTGC has been used to reuse memory cells locally in the procedures of the LP language Mercury [6]. Goal of the Research. RBMM achieves competitive memory consumption for many programs due to timely removal of dead regions and memory management operations are time bound. CTGC can exploit many reuse opportunities. Taking those advantages to have a system in which reusable memory can be reused and non-reusable dead memory can be deallocated timely is the motivation for our current research. The ultimate research goal is to investigate the possibility and practicality of a hybrid static memory management technique, which combines RBMM and CTGC. Current Status. Developing an algorithm that combines the nontrivial program analyses of CTGC in [6] and the type-based region inference in [5] has not been straightforward. Its main difficulty comes from the fact …

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Dynamic Memory Management for Sequential Logic Programming Languages

Logic programming languages are becoming more complex with the introduction of new features such as constraints or terms with an equality theory. With this increase in complexity, they require more and more sophisticated memory management. This survey gives an insight into the memory management problems in sequential logic programming language implementations ; it also describes the presently k...

متن کامل

Garbage Collection Techniques*

In the execution of logic programming languages, a logic variable can have only one value during its existence, after its instantiation it cannot be changed. Therefore, new values cannot be stored in the same memory cell which property is natural in imperative languages. For similar reasons, a data structure is always copied when a small modification is required. Because of it, memory consumpti...

متن کامل

Liveness of Heap Data for Functional Programs

Functional programming languages use garbage collection for heap memory management. Ideally, garbage collectors should reclaim all objects that are dead at the time of garbage collection. An object is dead at an execution instant if it is not used in future. Garbage collectors collect only those dead objects that are not reachable from any program variable. This is because they are not able to ...

متن کامل

Semantics of Memory Management for Polymorphic Languages

We present a static and dynamic semantics for an abstract machine that evaluates expressions of a polymorphic programming language. Unlike traditional semantics, our abstract machine exposes many important issues of memory management, such as value sharing and control representation. We prove the soundness of the static semantics with respect to the dynamic semantics using traditional technique...

متن کامل

A Target Implementation for High-Performance Functional Programs

We present a target implementation of a class of functional logic programming languages. We benchmark the functional component of our implementation on a small set of simple programs and compare its performance against the Glasgow Haskell Compiler. The results indicate that our approach is competitively efficient. We briefly outline the key characteristics of our implementation: underlying theo...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2006